Compat refresh for modern PyTorch/Python + multi-task batch_size=1 fixes#310
Merged
shenweichen merged 15 commits intomasterfrom Apr 18, 2026
Merged
Compat refresh for modern PyTorch/Python + multi-task batch_size=1 fixes#310shenweichen merged 15 commits intomasterfrom
shenweichen merged 15 commits intomasterfrom
Conversation
- keep Linear accumulator on input device to avoid cross-device errors - avoid global squeeze in BaseModel.fit for multi-task outputs - use squeeze(1) in MMOE/PLE expert-gating outputs - add batch_size=1 regression tests for MMOE and PLE
This was referenced Apr 18, 2026
Closed
Closed
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #310 +/- ##
==========================================
+ Coverage 92.56% 93.19% +0.62%
==========================================
Files 30 35 +5
Lines 2274 2483 +209
==========================================
+ Hits 2105 2314 +209
Misses 169 169
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- add dedicated callbacks unit tests covering EarlyStopping/ModelCheckpoint branches - add DeepFM column-vector target fit regression - add callback constructor docstrings and explicit metric imports for lint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR refreshes DeepCTR-Torch compatibility for modern environments and fixes multi-task edge cases observed on newer PyTorch/scikit-learn stacks.
Core compatibility updates
deepctr_torch.callbacksimplementationsRuntime/training fixes
BaseModelevaluation/logging pathbatch_size=1multi-task training shape issues by avoiding unsafe globalsqueeze()in fit pathsqueeze(1)instead of global squeeze)CI/tests
batch_size=1behaviorLinked Issues
Closes #281
Closes #288
Closes #303
Closes #305
Closes #263
Closes #309
Refs #301
Validation
python -m pytest -q tests/models/multitask/MMOE_test.py tests/models/multitask/PLE_test.py -k batch_size_onepython -m pytest -q tests/models/multitask